import { _decorator, Component, EventTarget, Node, resources, Sprite, SpriteFrame } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('LanauageManager')
export class LanauageManager {

    /**1英语，2马来语 */
    public static languageType:number = 1;

    public static popupLabelType:number = 1;

    public static popupCommonlType:number = 1;

    public static isInitData:boolean = false;

    public static isLoad:boolean = false;

    public static shopConfig = []

    public static taskConfig = [];

    public static languageConfig = [{"id":1,"english":"SETING","malay":"malay"},{"id":2,"english":"Sound","malay":""},{"id":3,"english":"Music","malay":""},{"id":4,"english":"Language","malay":""},{"id":5,"english":"Single-player","malay":""},{"id":6,"english":"Online Matching","malay":""},{"id":7,"english":"Warm-up/nactivation","malay":""},{"id":8,"english":"","malay":""},{"id":9,"english":"","malay":""},{"id":10,"english":"","malay":""},{"id":11,"english":"","malay":""},{"id":12,"english":"","malay":""},{"id":13,"english":"","malay":""},{"id":14,"english":"","malay":""},{"id":15,"english":"","malay":""},{"id":16,"english":"","malay":""},{"id":17,"english":"","malay":""},{"id":18,"english":"","malay":""},{"id":19,"english":"","malay":""},{"id":20,"english":"","malay":""},{"id":21,"english":"","malay":""},{"id":22,"english":"","malay":""},{"id":23,"english":"","malay":""},{"id":24,"english":"","malay":""},{"id":25,"english":"","malay":""},{"id":26,"english":"","malay":""},{"id":27,"english":"","malay":""},{"id":28,"english":"","malay":""},{"id":29,"english":"","malay":""}]
   
    public static getDesStrById(id:number){
        if (id == 0){
            return "";
        }
        let lang = LanauageManager.languageConfig[id-1];
        let str:string = "";
        if (lang){
            if (LanauageManager.languageType == 1){
                str = lang.english;
            }
            else if (LanauageManager.languageType == 2){
                str = lang.malay;
            }
        }
        return str.replace(/\\n/g, "\n");
    }

    public static playSound(){

    }

}

export class randItemData{

    user_id:number;

    username:string;

    avatar:string;

    num:number;

    rank:number;
}

